From 99eca4d6d8ebb1af1a5df33315bfaebbb565b9e7 Mon Sep 17 00:00:00 2001 From: robertl Date: Fri, 6 Oct 2006 14:45:13 +0000 Subject: [PATCH] Special case 'whitespace' in badchars. (Allows "w" in gpsdrive.) --- xcsv.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/xcsv.c b/xcsv.c index 32837cd8b..b6a9d0220 100644 --- a/xcsv.c +++ b/xcsv.c @@ -218,15 +218,11 @@ xcsv_parse_style_line(const char *sbuff) p = csv_stringtrim(xcsv_file.field_delimiter, " ", 0); /* field delimiters are always bad characters */ - if (xcsv_file.badchars) { - xcsv_file.badchars = (char *) xrealloc(xcsv_file.badchars, - strlen(xcsv_file.badchars) + - strlen(p) + 1); + if (0 == strcmp(p, "\\w")) { + xstrappend(xcsv_file.badchars, " \n\r"); } else { - xcsv_file.badchars = (char *) xcalloc(strlen(p) + 1, 1); + xcsv_file.badchars = xstrappend(xcsv_file.badchars, p); } - - strcat(xcsv_file.badchars, p); xfree(p); -- 2.30.2